﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BYManageInfoSystem
{
    class ClassUtility
    {
        public static Dictionary<string, string> m_dicCn2EngComp = new Dictionary<string, string>();
        public static Dictionary<string, string> m_dicCn2EngDep = new Dictionary<string, string>();
        public static Dictionary<string, string> m_dicCn2EngGS = new Dictionary<string, string>();


        static ClassUtility()
        {
            m_dicCn2EngComp.Add("进出口", "J");
            m_dicCn2EngComp.Add("兴经贸", "X");
            m_dicCn2EngComp.Add("商贸公司", "S");

            m_dicCn2EngDep.Add("进出口一部", "DMY");
            m_dicCn2EngDep.Add(" 进出口一部", "MXE");
            m_dicCn2EngDep.Add("李应昌组", "MCE");
            m_dicCn2EngDep.Add("商贸部", "MFE");
            m_dicCn2EngDep.Add("发展部", "MPE");
            m_dicCn2EngDep.Add("贸易部", "MTE");
            m_dicCn2EngDep.Add("发展二部", "MYE");
            m_dicCn2EngDep.Add("权组", "MQE");
            m_dicCn2EngGS.Add("公", "G");
            m_dicCn2EngGS.Add("私", "S");
        }
        public static void ResetAllTextBox(Form form)
        {
            for (int i = 0; i < form.Controls.Count; i++)
            {
                if (form.Controls[i] is TextBox)
                {
                    (form.Controls[i] as TextBox).Text = "";
                }

                if (form.Controls[i] is GroupBox)
                {
                    for (int j = 0; j < form.Controls[i].Controls.Count; j++)
                    {
                        if (form.Controls[i].Controls[j] is TextBox)
                        {
                            (form.Controls[i].Controls[j] as TextBox).Text = "";
                        }
                    }
                }
            }
        }

        public static void ResetAllTextBoxInGroupBox(GroupBox groupBox)
        {


            if (groupBox is GroupBox)
            {
                for (int j = 0; j < groupBox.Controls.Count; j++)
                {
                    if (groupBox.Controls[j] is TextBox)
                    {
                        (groupBox.Controls[j] as TextBox).Text = "";
                    }
                }
            }

        }
    }
}
